package com.qianyu.project.service.impl;

import com.qianyu.project.entity.Dept;
import com.qianyu.project.entity.ProjectInfo;
import com.qianyu.project.entity.SecurityLog;
import com.qianyu.project.entity.SystemUser;
import com.qianyu.project.mapper.SecurityLogMapper;
import com.qianyu.project.mapper.SystemUserMapper;
import com.qianyu.project.service.ISecurityLogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 安全日志 服务实现类
 * </p>
 *
 * @author gs
 * @since 2021-01-30
 */
@Service
public class SecurityLogServiceImpl extends ServiceImpl<SecurityLogMapper, SecurityLog> implements ISecurityLogService {
@Autowired
SecurityLogMapper securityLogMapper;
    @Autowired
    SystemUserMapper userMapper;
    @Override
    public List<SecurityLog> getSecurityLogList(SecurityLog sl) {
        return securityLogMapper.getSecurityLogList(sl);
    }

    @Override
    public List<ProjectInfo> getProjectName() {
        return securityLogMapper.getProjectName();
    }

    @Override
    public List<Dept> getDeptName() {
        return securityLogMapper.getDeptName();
    }

    @Override
    public List<SystemUser> getUserName() {
        return securityLogMapper.getUserName();
    }

    @Override
    public void deleteSecurityLogId(String id) {
        securityLogMapper.deleteSecurityLogId(id);
    }

    @Override
    public SecurityLog getSecurityLogId(String id) {
        return securityLogMapper.getSecurityLogId(id);
    }

    @Override
    public void addSecurityLog(SecurityLog ss) {
        ss.setApproveStatus("1");
        securityLogMapper.addSecurityLog(ss);
    }

    @Override
    public void updateSecurityLog(SecurityLog sl) {
        securityLogMapper.updateSecurityLog(sl);
    }
}
